﻿/**
 * ...
 * @author wangjun
 */
class cn.eminia.A2.Forms.CheckBox 
{
	
	var style = 'radioBtn';
	var arr = ['A', 'B', 'C', 'D']; 
	var result:String = undefined;
	var resultID:Number = undefined;
	var onSelect:Function;
	var onSelectNull:Function;
	public function CheckBox() 
	{
		
	} 
	/*
	 * 
	 * randomWaitrandomWaitrandomWaitrandomWaitrandomWaitrandomWaitrandomWait
	 */
	public function redo():Void {
		// KEEP FOR EVER !!
		/*for (var i = 0; i<arr.length; i++) {
		var o = this['s'+i];
		o.gotoAndStop(1);
		}*/
		for (var i:String in this) {
			if (this[i]._name.charAt(0) == 's') {
				this[i].gotoAndStop(1);
			}
		}
		this.result = undefined;
		this.resultID = undefined;
	}
	public function initSelect(i:Number):Void {
		this['s'+i].gotoAndStop(2);
		this.result = arr[i];
		this.resultID = i;
	}
	public function sel(i:Number):Void {
		this['s'+i].gotoAndStop(2);
		record(i);
	}
	public function recordNull():Void{
		this.onSelectNull();
	}
	public function record(i:Number):Void {
		this.result = arr[i];
		this.resultID = i;
		//trace("[" + getTimer() + "]" + "--EXE-- className::onSelect = " + onSelect);
		this.onSelect();
		//trace(this.result);
	}

	
}